package com.handshake.controller;

import com.handshake.entity.PaymentTransactionsEntity;
import com.handshake.service.PaymentTransactionsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;


/**
 * 支付记录表
 *
 * @author LcLee Tankiland@outlook.com
 * @since 1.0.0 2024-10-09
 */
@RestController
@RequestMapping("paymenttransactions")
@Tag(name="支付记录表")
public class PaymentTransactionsController {
    @Autowired
    private PaymentTransactionsService paymentTransactionsService;
    @GetMapping("/{id}")
    public PaymentTransactionsEntity getpaymentTransactions(@PathVariable Long id) {
        return paymentTransactionsService.getById(id);
    }
    //获取用户列表
    @GetMapping("/list")
    public List<PaymentTransactionsEntity> listPaymentTransactions() {
        return paymentTransactionsService.list();
    }
    //新增用户
    @PostMapping("/add")
    public void addPaymentTransactions(@RequestBody PaymentTransactionsEntity paymentTransactions) {
            paymentTransactionsService.save(paymentTransactions);
    }
    //更新用户
    @PutMapping("/update")
    public void updatePaymentTransactions(@RequestBody PaymentTransactionsEntity paymentTransactions) {
            paymentTransactionsService.updateById(paymentTransactions);
    }
    //删除用户
    @DeleteMapping("/{id}")
    public void deletePaymentTransactions(@PathVariable Long id) {
            paymentTransactionsService.removeById(id);
    }

}
